import request from '@/utils/request'

/**
 * 登录
 */
export function Login(User) {
  return request({
    url: 'http://localhost:8090/user/login',
    method: 'post',
    data: User,
  })
}

/**
 * 查询全部 user
 */
export function getUserInfo() {
  return request({
    url: 'http://localhost:8090/user/find',
    method: 'get',
  })
}

/**
 * 根据id查找用户信息
 * @param uid
 * @returns {*}
 * @constructor
 */
export function My(uid) {
  return request({
    url: 'http://localhost:8090/user/myUser',
    method: 'post',
    data: {
      uid: uid,
    },
  })
}

export function aaa() {
  return request({
    url: 'http://localhost:8090/user/a',
    method: 'get',
  })
}
/**
 *
 * 上传头像
 * @param file
 * @param id
 * @returns {Promise<Data<unknown>>}
 */
export function uploadAvatar(file, id) {
  return request({
    url: 'http://localhost:8090/user/upMinio',
    method: 'POST',
    data: {
      file: file,
      id: id,
    },
  })
}
